package com.report.enumeration;

public enum MergeNodeEnum {
    DIRECT_SUBORDINATE(0, "直接下级"),
    ALL_SUBORDINATE(1, "所有下级");

    private int code;

    private String desc;

    private MergeNodeEnum(int code, String desc) {
        this.code = code;
        this.desc = desc;
    }

    public int getCode() {
        return code;
    }

    public String getDesc() {
        return desc;
    }

    public static MergeNodeEnum getByCode(int code) {
        for (MergeNodeEnum value : values()) {
            if (value.code == code) {
                return value;
            }
        }
        return null;
    }

    public static MergeNodeEnum getByDesc(String desc) {
        for (MergeNodeEnum value : values()) {
            if (value.desc.equals(desc)) {
                return value;
            }
        }
        return null;
    }
}
